<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<!-- Copyright 1997 The Open Group, All Rights Reserved -->
<title>swab</title>
</head><body bgcolor=white>
<center>
<font size=2>
The Single UNIX &reg; Specification, Version 2<br>
Copyright &copy; 1997 The Open Group

</font></center><hr size=2 noshade>
<h4><a name = "tag_000_009_258">&nbsp;</a>NAME</h4><blockquote>
swab - swap bytes
</blockquote><h4><a name = "tag_000_009_259">&nbsp;</a>SYNOPSIS</h4><blockquote>
<pre><code>

#include &lt;<a href="unistd.h.html">unistd.h</a>&gt;

void swab(const void *<i>src</i>, void *<i>dest</i>, ssize_t <i>nbytes</i>);
</code>
</pre>
</blockquote><h4><a name = "tag_000_009_260">&nbsp;</a>DESCRIPTION</h4><blockquote>
The
<i>swab()</i>
function copies
<i>nbytes</i>
bytes, which are pointed to by
<i>src</i>,
to the object pointed to by
<i>dest</i>,
exchanging adjacent bytes.  The
<i>nbytes</i>
argument should be even.
If
<i>nbytes</i>
is odd
<i>swab()</i>
copies and exchanges
<i>nbytes</i>-1
bytes and the disposition of the last byte is unspecified.
If copying takes place between objects that overlap, the
behaviour is undefined.
If
<i>nbytes</i>
is negative,
<i>swab()</i>
does nothing.
</blockquote><h4><a name = "tag_000_009_261">&nbsp;</a>RETURN VALUE</h4><blockquote>
None.
</blockquote><h4><a name = "tag_000_009_262">&nbsp;</a>ERRORS</h4><blockquote>
No errors are defined.
</blockquote><h4><a name = "tag_000_009_263">&nbsp;</a>EXAMPLES</h4><blockquote>
None.
</blockquote><h4><a name = "tag_000_009_264">&nbsp;</a>APPLICATION USAGE</h4><blockquote>
None.
</blockquote><h4><a name = "tag_000_009_265">&nbsp;</a>FUTURE DIRECTIONS</h4><blockquote>
None.
</blockquote><h4><a name = "tag_000_009_266">&nbsp;</a>SEE ALSO</h4><blockquote>
<i><a href="unistd.h.html">&lt;unistd.h&gt;</a></i>.
</blockquote><h4>DERIVATION</h4><blockquote>
Derived from Issue 1 of the SVID.
</blockquote><hr size=2 noshade>
<center><font size=2>
UNIX &reg; is a registered Trademark of The Open Group.<br>
Copyright &copy; 1997 The Open Group
<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]

</font></center><hr size=2 noshade>
</body></html>

